//
//  DatasourceViewController.h
//  ebook
//
//  Created by 吴超飞 on 16/1/15.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DataViewController.h"
#import "PageData.h"

#define kAdjustFontNotification     @"kAdjustFontNotification"

@class DatasourceViewController;
@protocol DatasourceViewControllerDelegate <NSObject>

/*前、后翻页：isforward；
 *是否更新数据：needget,需要更新数据源
 *是否已经跳过去了：skiped，用动画翻页时YES调用者只需切换数据源，NO切换数据后做一次跳转；无动画时恒为NO
 */
-(void)datasourceViewController:(DatasourceViewController *)datasourceViewController isForward:(BOOL)isforward shouldGetData:(BOOL)needget currentViewcontroller:(DataViewController *)vc;

@end

@interface DatasourceViewController : NSObject<UIPageViewControllerDataSource,UIPageViewControllerDelegate>

@property (nonatomic, assign) NSInteger index;//当前显示的页(只记录初始值，翻页中并不会跟随改变)

@property (nonatomic, retain) PageData *currentPageData;//当前显示的对象
@property (nonatomic, strong) NSArray *pageDatas;//分页数据 PageObject对象

@property (nonatomic, assign) BOOL pageIsAnimating;//YES：正在做翻页或滚动动画

@property (nonatomic, weak  ) id<DatasourceViewControllerDelegate> delegate;

- (void)updateDatasource:(NSDictionary *)dict;//更新数据源

- (DataViewController *)viewControllerAtIndex:(NSUInteger)index;

- (NSUInteger)indexOfViewController:(DataViewController *)viewController;

- (void) onStopInteroperate;

@end
